<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::group(['prefix' => 'allow', 'namespace' => 'API\Allow'], function () {
    Route::post('data/token', 'DataController@token');
    Route::get('data/skill', 'DataController@skill');
    Route::get('data/order', 'DataController@order');
    Route::get('data/copyright', 'DataController@copyright');

    Route::post('tool/reset-account', 'ToolController@resetAccount');
    Route::post('tool/clear-cache', 'ToolController@clearCache');
    Route::post('tool/make-hash', 'ToolController@makeHash');
    Route::post('tool/add-note-balance', 'ToolController@addNoteBalance');
    Route::post('tool/add-alert-message', 'ToolController@addAlertMessage');
});

Route::group(['prefix' => 'admin', 'namespace' => 'API\Admin'], function () {
    Route::get('module_types/get-values', 'ModuleTypeController@getValues');
    Route::get('debris/get-classifies', 'DebrisController@getClassifies');

    Route::post('home/search-words', 'HomeController@SearchWords');
    Route::post('home/derivate-keywords', 'HomeController@DerivateKeywords');
    Route::post('home/area-keywords', 'HomeController@AreaKeywords');
    Route::post('home/keyword-infos', 'HomeController@KeywordInfos');

    Route::post('home/module-infos', 'HomeController@ModuleInfos');

    Route::post('home/user-views', 'HomeController@UserViews');
    Route::post('home/ip-sort', 'HomeController@IpSort');
    Route::post('home/ip-sort/location', 'HomeController@IpSortLocation');
});

Route::group(['prefix' => 'ui', 'namespace' => 'API\UI'], function () {
    Route::get('tql/index', 'TqlController@index');
    Route::get('tql/mindex', 'TqlController@mindex');
});

Route::group(['prefix' => 'tools', 'namespace' => 'API\Tools'], function () {
    Route::post('message/{form}', 'MessageController@index');

    Route::get('last-info', 'ToolController@lastInfo');
});

Route::group(['prefix' => '_chat', 'namespace' => 'API\UI'], function () {
    Route::post('take-msg', 'ChatController@takeMsg');
});
